package com.shuai.controller;
import com.shuai.entity.ProjectUserRelation;
import com.shuai.result.Result;
import com.shuai.service.ProjectUserRelationService;
import com.shuai.vo.ProjectUserRelationVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/projectUserRelation")
@Slf4j
@Api(tags = "项目团队相关接口")
public class ProjectUserRelationController {
    @Autowired
    private ProjectUserRelationService projectUserRelationService;

    @Autowired
    private RedisTemplate redisTemplate;

    /**
     * 根据项目id查询
     * @param projectId
     * @return
     */
    @GetMapping("/list/{projectId}")
    @ApiOperation("根据项目id查询相关成员")
    public Result<List<ProjectUserRelationVO>> list(@PathVariable Long projectId) {
        log.info("根据项目id查询相关成员，projectId:{}",projectId);
        List<ProjectUserRelationVO> list = projectUserRelationService.list(projectId);
        return Result.success(list);
    }



}
